#include "GameEntity.h"

#include "../Managers/GameService.h"
#include "../Managers/LevelManager.h"

//-------------------------------------------------------------------------------------------
GameEntity::GameEntity(int team)
{
	SetTeam(team);
	SetSpeed(2);
	SetProgress(0);

	m_pLevelManager = GameService::GetInstance()->GetLevelManager();
}

//-------------------------------------------------------------------------------------------
GameEntity::~GameEntity()
{
}

//-------------------------------------------------------------------------------------------
void GameEntity::OnNodeReached()
{
	m_pCurrentNodeID = m_pDestinationNodeID;
	SetProgress(0);
}

//-------------------------------------------------------------------------------------------
void GameEntity::Tick(float DeltaTime)
{
}

//-------------------------------------------------------------------------------------------
bool GameEntity::OnInput(sf::Event::KeyEvent* pKeyEvent, bool keyDown)
{
	return false;
}

//-------------------------------------------------------------------------------------------
void GameEntity::SetTeam(int team)
{
	m_team = team;
}

//-------------------------------------------------------------------------------------------
int GameEntity::GetTeam()
{
	return m_team;
}

//-------------------------------------------------------------------------------------------
void GameEntity::SetSpeed(float speed)
{
	m_speed = speed;
}

//-------------------------------------------------------------------------------------------
float GameEntity::GetSpeed()
{
	return m_speed;
}

//-------------------------------------------------------------------------------------------
void GameEntity::SetProgress(float progress)
{
	m_progress = progress;
}

//-------------------------------------------------------------------------------------------
float GameEntity::GetProgress()
{
	return m_progress;
}

//-------------------------------------------------------------------------------------------
void GameEntity::SetPosition(int nodeID)
{
	m_pCurrentNodeID = nodeID;
	m_pDestinationNodeID = nodeID;
	m_progress = 1;
}

//-------------------------------------------------------------------------------------------
int GameEntity::GetCurrentNodeID()
{
	return m_pCurrentNodeID;
}

//-------------------------------------------------------------------------------------------
int GameEntity::GetDestinationNodeID()
{
	return m_pDestinationNodeID;
}

//-------------------------------------------------------------------------------------------